﻿Imports System.Collections.Generic
Imports Pop.Api.Response
Imports Pop.Api.Util
Namespace Pop.Api.Request
    ''' <summary>
    ''' 1.11 (初级)买家查询商品列表接口
    ''' </summary>
    Public Class BuyerSearchItemListRequest
        Inherits PopRequest(Of BuyerSearchItemListResponse)

        ''' <summary>
        ''' 查询第几页
        ''' </summary>
        Property PageIndex As Nullable(Of Long)

        ''' <summary>
        ''' 每页显示的记录数
        ''' </summary>
        Property PageSize As Nullable(Of Long)

        ''' <summary>
        ''' 卖家QQ号
        ''' </summary>
        Public Property SellerUin As Nullable(Of Long)

        ''' <summary>
        ''' 例如如果设置为“森林”，那么商品标题中带有“森林”词的商品列表就会被查找出来.
        ''' 需要过滤特殊字符，包含在中括号内的: 【\】
        ''' </summary>
        Property ItemName As String

        ''' <summary>
        ''' 目标商品的状态值 1.出售中
        ''' </summary>
        Property ItemState As Nullable(Of Long)

        ''' <summary>
        ''' 
        ''' </summary>
        Property ItemTags As String

        ''' <summary>
        ''' 店铺自定义分类，“0” 查询未分类商品
        ''' </summary>
        Property CategoryId As String

        ''' <summary>
        ''' 目标商品的第一次发布时间条件区间里的左边界值
        ''' 时间格式：yyyy-MM-dd HH:mm:ss
        ''' </summary>
        Property CreateTimeBegin As String

        ''' <summary>
        ''' 目标商品的第一次发布时间条件区间里的右边界值
        ''' 时间格式：yyyy-MM-dd HH:mm:ss
        ''' </summary>
        Property CreateTimeEnd As String

        ''' <summary>
        ''' 目标商品的最后变更时间条件区间里的左边界值
        ''' 时间格式：yyyy-MM-dd HH:mm:ss
        ''' </summary>
        Property ModifyTimeBegin As String

        ''' <summary>
        ''' 目标商品的最后变更时间条件区间里的右边界值
        ''' 时间格式：yyyy-MM-dd HH:mm:ss
        ''' </summary>
        Property ModifyTimeEnd As String

        ''' <summary>
        ''' 目标商品的上架时间条件区间里的 左边界值
        ''' 时间格式：yyyy-MM-dd HH:mm:ss
        ''' </summary>
        Property ToSaleTimeBegin As String

        ''' <summary>
        ''' 目标商品的上架时间条件区间里的 右边界值
        ''' 时间格式：yyyy-MM-dd HH:mm:ss
        ''' </summary>
        Property ToSaleTimeEnd As String

        ''' <summary>
        ''' 目标商品价格大于等于 单位：分
        ''' </summary>
        Property PriceMorethan As Nullable(Of Long)

        ''' <summary>
        ''' 目标商品价格小于等于 单位：分
        ''' </summary>
        Property PriceLessthan As Nullable(Of Long)

        ''' <summary>
        ''' 是否需要返回商品的附属信息
        ''' </summary>
        Property ExtendInfo As Nullable(Of Long)

        ''' <summary>
        ''' 目标商品列表的排序方式：
        ''' 2, 发布时间升序排列 
        ''' 3, 发布时间降序排列 
        ''' 8, 价格升序排列 
        ''' 9, 价格降序排列 
        ''' </summary>
        Property OrderType As Nullable(Of Long)

#Region "Overrides"

        Protected Overrides Function GetApiName() As String
            Return "item.buyerSearchItemList"
        End Function

        Protected Overrides Function GetParameters() As IEnumerable(Of KeyValuePair(Of String, String))
            Dim parameters As New PopDictionary
            parameters.Add("sellerUin", Me.SellerUin)
            parameters.Add("pageIndex", Me.PageIndex)
            parameters.Add("pageSize", Me.PageSize)
            parameters.Add("itemName", Me.ItemName)
            parameters.Add("itemState", Me.ItemState)
            parameters.Add("itemTags", Me.ItemTags)
            parameters.Add("categoryId", Me.CategoryId)
            parameters.Add("createTimeBegin", Me.CreateTimeBegin)
            parameters.Add("createTimeEnd", Me.CreateTimeEnd)
            parameters.Add("modifyTimeBegin", Me.ModifyTimeBegin)
            parameters.Add("modifyTimeEnd", Me.ModifyTimeEnd)
            parameters.Add("toSaleTimeBegin", Me.ToSaleTimeBegin)
            parameters.Add("toSaleTimeEnd", Me.ToSaleTimeEnd)
            parameters.Add("priceMorethan", Me.PriceMorethan)
            parameters.Add("priceLessthan", Me.PriceLessthan)
            parameters.Add("extendInfo", Me.ExtendInfo)
            parameters.Add("orderType", Me.OrderType)
            Return parameters
        End Function

        Protected Overrides Sub Validate()
            Me.PageIndex.ValidateRequired("PageIndex")
            Me.PageSize.ValidateRequired("PageSize")
            Me.SellerUin.ValidateRequired("SellerUin")
        End Sub

#End Region

    End Class
End Namespace